﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    
}
@model  IList<VVA.Data.Entity.Taxonomy>

<div class="content-box">
    <div class="content-box-header">
        <h3>@ViewBag.Title</h3>
    </div>
    <div class="content-box-content">
        <table id="tblTaxonomy">
            <thead>
                <tr>
                    <th style="width: 20px;">
                        <input class="check-all" type="checkbox" />
                    </th>
                    <th>@HttpContext.GetLocalResourceObject(this.VirtualPath, "CategoryName")
                    </th>
                    <th style="width: 60px"></th>
                </tr>
            </thead>
            <tbody>
                @if (Model.Count() > 0)
                {
                    foreach (var item in Model)
                    {
                    <tr id="@item.TaxonomyID">
                        <td>
                            <input type="checkbox" />
                        </td>
                        <td>@item.TaxonomyName
                        </td>
                        <td style="text-align: center">
                            <a href="@Url.RouteUrl("Category", new { id = item.TaxonomyID, action = "Edit" })" class="edit-button">
                                <img src="@Url.Content("~/Areas/Admin/Content/Images/Icons/pencil.png")" alt="Alternate Text" /></a>
                            <a href="javascript:void(0)" class="remove-button" data-key="@item.TaxonomyID" delete-url="@Url.Action("Delete")" confirm-text="@string.Format(HttpContext.GetGlobalResourceObject("Common", "DeleteConfirmText").ToString(), HttpContext.GetLocalResourceObject(this.VirtualPath, ViewBag.Table).ToString())">
                                <img src="@Url.Content("~/Areas/Admin/Content/Images/Icons/cross.png")" alt="Alternate Text" /></a>
                        </td>
                    </tr>
                    }
                }
                else
                {
                    <tr>
                        <td colspan="3">@HttpContext.GetGlobalResourceObject("Common", "EmptyRecord")</td>
                    </tr>
                }
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="3">
                        <div class="bulk-actions align-left">
                            @Html.RouteLink(HttpContext.GetGlobalResourceObject("Common", "AddNew").ToString(), "Category", new { action = "Create" }, new { @class = "button" })
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var tableName = "@this.ViewContext.RouteData.Values["table"]";
        switch (tableName) {
            case "Product":
                $("#mnuProduct").addClass("current");
                $("#mnuManageProductCategory").addClass("current");
                break;
            default:
                $("#mnuArticle").addClass("current");
                $("#mnuManageArticleCategory").addClass("current");
                break;
        }
    });
</script>
